﻿<%@ Page Language="C#" AutoEventWireup="true"
    Inherits="website_admin_members_shippingaddresslist" Codebehind="shippingaddresslist.aspx.cs" %>

<%@ Register Src="../../admin/_root/_controls/ctlNavBar.ascx" TagName="ctlNavBar"
    TagPrefix="uc1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
    <title></title>

    <script src="../_common/scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
      
    <script type="text/javascript" language="javascript" src="../_common/scripts/util.js"></script>

    <script src="../_static/_jQuery/jquery_json.js" type="text/javascript"></script>
    <script src="../_static/_jQuery/jquery_stringutil.js" type="text/javascript"></script>
    <link href="../_common/styles/frame_global.css" rel="stylesheet" type="text/css" />

    <script language="javascript" type="text/javascript">
        function window.onload() {
            LoadingData();
            LoadRegionList('init', 'province', 1);
        }
        function Search()
        {
            pageIndex = "1";
            LoadingData();
        }
        var pageIndex = "";
        function pagination(index)
        {
            pageIndex = index;
            LoadingData();
        }
        function LoadingData() {
            $.ajax({
                async: true,
                type: "POST",
                url: "shippingaddresslist.aspx",
                data: {
                    index: pageIndex,
                    otype: "loadingdata",
                    regionnumber: $("#txtRegionNumber").val(),
                    username: $("#txtUsername").val(),
                    address: $("#txtShippingAddress").val()
                },
                beforeSend: function() {
                    $("#divLoading").css("display", "block");
                    $("#divItemsList").html("");
                },
                success: function(data, textStatus) {
                    $("#divLoading").css("display", "none");
                    $("#divItemsList").html(data);
                }
            });
        }
        function LoadRegionList(loadingtype, layername, _layer)
        {
            var _parentid = "";
            if(layername == "province")
                _parentid = "0";   
            if(layername == "city")
                _parentid = $("#selProvinceList").val(); 
            if(layername == "countie")
                _parentid = $("#selCityList").val();
                
            if(_parentid != "")
            {
                $.ajax({
                    async   :   false,
                    type    :   "POST",
                    url     :   prependOrgName("/website_admin/members/shippingaddresslist.aspx"),
                    data    :   { otype : "getregionlist", layer: _layer, parentid : _parentid },
                    success :   function(data, textStatus) {
                        switch(_layer)
                        {
                            case 1:
                                $("#selProvinceList").emptySelect().append(data).change(function() { 
                                    $("#txtRegionNumber").val($("#selProvinceList").val()); 
                                    LoadRegionList("event", "city", 2);
                                    LoadRegionList("event", "countie", 3);
                                });
                                break;
                            case 2:
                                $("#selCityList").emptySelect().append(data).change(function() {
                                    $("#txtRegionNumber").val($("#selCityList").val()); 
                                    LoadRegionList("event", "countie", 3); 
                                });
                                break;
                            case 3:
                                $("#selCountiesList").emptySelect().append(data).change(function() { 
                                    $("#txtRegionNumber").val($("#selCountiesList").val()); 
                                }); 
                                break;
                        }
                    }
                }); 
            }
            else
            {
                if($("#selProvinceList").val() == "")
                {
                    $("#selCityList").emptySelect().append("<option value=''>-- 请选择城市 --</option>"); 
                    $("#txtRegionNumber").val("");
                }
                if($("#selCityList").val() == "")
                {
                    $("#selCountiesList").emptySelect().append("<option value=''>-- 请选择区县 --</option>"); 
                }
            }
        }
        function OpenDia(otype)
        {
            var groupid=getUrlParam("groupid");
            switch(otype)
            {
                case "add":
                    window.location.href="memberinfoeditor.aspx?otype=add&groupid="+groupid;
                    break;
            }
        } 
        function View(objectId)
        {
            window.location.href="memberinfoeditor.aspx?otype=modify&groupid="+getUrlParam("groupid")+"&userid="+objectId;
        } 
    </script>

</head>
<body>
    <form id="aspnetForm" runat="server">
    <div class="divAreas">
        <div class="boxTopBar">
            <div class="boxTopBarLeft">
                <div class="navBar">
                    <uc1:ctlNavBar ID="ctlNavBar1" runat="server" />
                </div>
            </div>
            <div class="boxTopBarRight">
            </div>
        </div>
        <div class="boxMain">
            <div class="boxMainBody">
                <table cellpadding="0" cellspacing="0" class="stdTable" style="width: 98%;">
                    <tbody>
                        <tr style="height: 32px;">
                            <td style="padding: 0px 5px 0px;">
                                <table class="stdTable" cellpadding="0" cellspacing="0">
                                    <colgroup>
                                        <col style="padding-right: 5px; text-align: right; width: 60px;" />
                                        <col style="width: 120px;" />
                                        <col style="padding-right: 5px; text-align: right; width: 70px;" />
                                        <col style="width: 120px;" />
                                        <col style="padding-right: 5px; text-align: right; width: 70px;" />
                                        <col />
                                        <col style="width: 80px; padding-left: 5px;" /> 
                                    </colgroup>
                                    <tr>
                                        <td>
                                            会员名：
                                        </td>
                                        <td>
                                            <input type="text" id="txtUsername" name="txtUsername" class="textBox" />
                                        </td>
                                        <td>
                                            地址信息：
                                        </td>
                                        <td>
                                            <input type="text" id="txtShippingAddress" name="txtShippingAddress" class="textBox" />
                                        </td>
                                        <td>
                                            <label for="selProvinceList">
                                                地区：</label>
                                        </td>
                                        <td>
                                            <select id="selProvinceList" name="selProvinceList" class="SelectBox" style="width: 100px;">
                                            </select>
                                            <select id="selCityList" name="selCityList" class="SelectBox" style="width: 120px;">
                                                <option value="">-- 选择城市 --</option>
                                            </select>
                                            <select id="selCountiesList" name="selCountiesList" class="SelectBox" style="width: 120px;">
                                                <option value="">-- 选择区县 --</option>
                                            </select>
                                            <input type="hidden" id="txtRegionNumber" name="txtRegionNumber" />
                                        </td>
                                        <td>
                                            <input id="Button1" class="btn_s" value="查 询" type="button" onclick="Search();" />
                                        </td> 
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr style="height: 100%;">
                            <td valign="top" style="padding: 5px 5px 0px;">
                                <table cellpadding="0" cellspacing="0" class="Form-Gruid" align="center" style="height: 100%;">
                                    <tbody>
                                        <tr>
                                            <td style="background: #ffffff; vertical-align: top;">
                                                <div id="divLoading" style="display: none;">
                                                    <table style="background-color: #FFFFFF; border: solid 1px #eoeoeo; table-layout: fixed;
                                                        width: 100%; height: 100%;" cellpadding="0" cellspacing="0">
                                                        <tr>
                                                            <td style="vertical-align: middle" align="center">
                                                                <img src="../_imgs/admin/progress.gif" /><br />
                                                                加载数据 ...
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </div>
                                                <div id="divItemsList">
                                                </div>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="boxBottomBar">
            <div class="boxBottomBarLeft">
                &nbsp;
            </div>
            <div class="boxBottomBarRight">
                &nbsp;
            </div>
        </div>
    </div>
    </form>
</body>
</html>
